<?php

$yes_no = Array('No', 'Yes');

echo '<table frame="border">';
foreach($query_restaurant->result() as $row)
{
	echo '
	Restaurant<br/>
	<font size="6">'.$row->name.'</font><br/>
	added '.$row->date.' by '.$row->author.'<br/><br/>

	<tr>
		<td>Kitchen</td>
		<td>'.$row->kitchen.'</td>
	</tr>
	<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
	
	<tr>
		<td>Fastfood</td>
		<td>'.$yes_no[$row->fastfood].'</td>
	</tr>	
	<tr>
		<td>Vegetarian</td>
		<td>'.$yes_no[$row->vegetarian].'</td>
	</tr>
	<tr>
		<td>Take-Away</td>
		<td>'.$yes_no[$row->takeaway].'</td>
	</tr>	
	<tr>
		<td>Alcohol Licensing</td>
		<td>'.$yes_no[$row->alcohol].'</td>
	</tr>
	<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
	
	<tr>
		<td>Opening hours</td>
		<td>'.$row->opening_hours.'</td>
	</tr>
	<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
	
	<tr>
		<td>Address</td>
		<td><div id="btn_gm" style="cursor: hand;"><button>Open GoogleMap</button></div></td>
	</tr>
	<tr>
		<td>Street</td>
		<td>'.$row->address_street.'</td>
	</tr>
	<tr>
		<td>Zipcode</td>
		<td>'.$row->address_zipcode.'</td>
	</tr>
	<tr>
		<td>City</td>
		<td>'.$row->address_city.'</td>
	</tr>
	<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
	
	<tr>
		<td>Pictures</td>
		<td><div id="btn_flickr" style="cursor: hand;"><button>Open Album</button></div></td>
	</tr>
	<tr>
		<td>Recommend</td>
		<td><div id="btn_recommend_user" style="cursor: hand;"><button>To User</button></div></td>
	</tr>
	</table>';
}


echo '<h2></br>Reviews</h2><br/>';
foreach($query_review->result() as $row)
{
	echo '<table bgcolor="#4A4A4A" frame="border">';
	echo '
	<tr>
		<td>'.$row->message.'</td>
		<td>&nbsp;</td>
	</tr>';
	echo '</table></br>';
}


echo '<textarea id="review" rows="3" cols="33"></textarea></br>';
echo '<button id="btn_review">Write Review</button>';
echo '<button id="btn_back">Back</button>';
echo '<button id="btn_edit">Edit</button>';

//if loged in show the add to favorite button
if($username != ""){echo '<button id="btn_add_to_favorite">Add to Favorite</button>';}

echo '<div id="review_response_display"></div>';


?>

